package com.colbert.jknife.sample;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.colbert.jknife.JKnife;
import com.colbert.jknife.annotation.BindView;
import com.colbert.jknife.annotation.OnClick;
import com.colbert.jknife.annotation.OnLongClick;

public class MainActivity extends AppCompatActivity {

    @BindView(R.id.txt_hello)
    TextView txtHello;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        JKnife.inject(this);
    }

    @OnClick({R.id.txt_hello, R.id.txt_world})
    public void sayHello(View v) {
        Log.i(MainActivity.class.getName(), "hello world!");
    }

    @OnLongClick({R.id.txt_world})
    public void sayHello2(View v) {
        Log.i(MainActivity.class.getName(), "hello world!");
    }
}
